<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="http://stc.ws.t.elef.top:8080/socket.io/socket.io.js"></script>
    <script>
        const serviceurl = "http://stc.ws.t.elef.top:8080";
        const socket = io.connect(serviceurl ,{ path: "/socket.io" });

        
        function send(){

            socket.emit("screen_event",{ fromclient :"b", action:"url",content : "https://baidu.com" });
        }

        socket.on("screen_event",function({ fromclient,action,content }){

            
            document.querySelector("#showcontent").innerHTML += "<br/>" + JSON.stringify({ fromclient,action,content });
            

        });



    </script>
</head>
<body>
    <div id="showcontent">


    </div>
    <button onclick="send()">发送</button>


    <script>

       
       
        
       

    </script>
</body>
</html>